Digital television and video streaming technology has enabled people, no matter where they live, to have access to huge amounts of information. Although video typically takes up a large amount of space, digital compression techniques mean that many megabytes of data can be transmitted in the form of stored files as well as real-time data (live streaming). The applications of this technology are far reaching: high quality live streaming has seen its most recent application in the Middle East, where world changing events have been documented and transmitted all over the world almost as soon as they happen.
Digital compression falls into two types: lossless and lossy compression. Lossy compression involves compressing the video data so that the compressed file has less data than the original data. When the file is received and viewed, there will therefore be a loss of quality compared to the original footage. Lossless compression, as indicated by the name, can compress a file so that it includes almost the same amount of data as the original data, thereby preserving the quality. Current examples of coding standards employing lossless compression are MPEG-4 and H.264, which are the leading standards used in high-definition video.
As all information must be preserved in lossless compression, compression techniques which can reduce the size of a file to be transmitted are very important. H.264 is able to perform almost lossless compression by taking advantage of Variable Length Coding (VLC) and Context Adaptive Binary Arithmetic Coding (CABAC) which can render information digitally at low bit rates. CABAC transforms data into bits, encodes them as binary symbols, and applies multiple probability models to the binary symbols which are selected adaptively. A number of binarization techniques can be used. Unary binarization is a technique which converts a codeword into a string of ONES followed by a terminating ZERO. This has the advantage of making each codeword uniquely distinguishable but larger codewords will be very long, as the number of bins depends on the size of the largest value. An alternative binarization method is Exponential-Golomb (exp-Golomb) binarization wherein a codeword is split into a unary prefix and a binary suffix. This form of binarization reduces the number of bins which need to be sent through a binary arithmetic coder (BAC), but has the disadvantage of being unable to quickly distinguish between smaller and larger codewords.
In order to exploit the positive aspects of both systems of binarization, hybrid binarization schemes are often used. For HEVC coding, which is the next generation coding standard beyond H.264 and MPEG-4, a hybrid Rice binarization scheme is used. The binarization consists of a prefix part and (when present) a suffix part. The prefix part of the binarization is derived by invoking the TR binarization process. When the prefix bit string does not fit in with a predefined criterion, a suffix bin string will be created by using the EGk binarization. For example, when the prefix bin string is equal to the bit string of length 4 with all bits equal to 1, the bin string consists of a prefix bin string and a suffix bin string. The suffix bin string is derived using the EGk binarization.
In the EGk binarization scheme, the Rice parameter is used to divide the suffix into a quotient and a remainder, and k is defined by the Rice parameter. The quotient part will be coded using unary binarization and the remainder will be coded in binary. Thus, a codeword representing a value above the threshold can be said to consist of a 1st portion (initial prefix), a 2nd portion (quotient) and a 3rd portion (remainder). FIG. 2A and FIG. 2B are exemplary tables illustrating input symbols coded using a hybrid Truncated Rice, exp-Golomb binarization scheme for different values of Rice Parameter for EGk and EG0 respectively.
Please note that all codewords shown in the table of FIG. 2.A (apart from the codeword for input symbol above 4 for a Rice Parameter equal to 0 and input symbol above 8 for a Rice Parameter equal to 1) are binarized using a TR binarization only; in other words, the codeword only consists of an initial prefix. Similarly, all codewords shown in the table of FIG. 2.B (apart from the codeword for input symbol above 7 and 14 for Rice Parameter equal to 0 and 1, respectively) are binarized using a TR binarization only. TR binarization codes an input symbol as a codeword having a prefix and a suffix, wherein the suffix can be directly selected from the least significant bits of the input symbol in binary form. The number of least significant bits will be defined by the Rice Parameter. The number of bins of the prefix is then defined by the decimal value of the most significant bits. An example will be given for the input symbol 12, and assuming a Rice Parameter of two (i.e. cRP=2). The input symbol is first converted into binary to give the value ‘1100’. The cRP least significant bits of this binary value are ‘00’; these two bits will form the suffix of the codeword. The value ‘1100’ is then right shifted by two (the number of bits of the suffix) to obtain the value ‘11’. This value is converted back to decimal, i.e. ‘3’. Therefore, the prefix part of the codeword consists of three ONES with a truncating ZERO (i.e., ‘1110’. The input symbol 12 coded using a Truncated Rice with cRP=2 therefore gives ‘1110 00’. The values 13-15 also yield ‘3’ in decimal when they are right shifted by cRP bits, i.e. their most significant bits are all the same. Their corresponding TR codewords are ‘1110 01’, ‘1110 10’ and ‘1110 11’. Another example will be given for the same input symbol 12, but assuming a Rice Parameter of one (i.e. cRP=1). The input symbol is first converted into binary to give the value ‘1100’. The cRP least significant bit of this binary value is ‘0’; this single bit will form the suffix of the codeword. The value ‘1100’ is then right shifted by one (the number of bits of the suffix) to obtain the value ‘110’. This value is converted back to decimal, i.e. ‘6’. Therefore, the prefix part of the codeword consists of six ONES with a truncating ZERO, i.e. ‘1111110’. The input symbol 12 coded using a Truncated Rice with cRP=1 therefore gives ‘1111110 0’. In this case, however, the final codeword could be too long and therefore EGk with prefix could be applied. As indicated in FIG. 2D, the input symbol 12 with a Rice Parameter of one is coded by ‘1111 100 00’ in which its codeword length is shorter compared with the TR code. A preferred embodiment would check the length of the TR codeword in order to decide whether to use TR code or switch to an EGk base codeword with an initial prefix. Another preferred embodiment would check the number of ONES in the prefix part of the TR codeword. If this number is larger than a predefined criterion, the input symbol would be coded by EGk with an initial codeword. This number of ONES is 4 and 3 in the FIG. 2D and FIG. 2E, respectively. Please note that, when the Rice Parameter is zero, the corresponding codewords are equivalent to input symbols coded using a Truncated unary binarization.
Conventional methods of coding an input symbol according to the above hybrid binarization scheme consist of first creating a codeword using Truncated Rice binarization, determining whether the prefix bit string does not fit in with a predefined criterion, and if so, creating a suffix bin string by using the above described EGk binarization. Another conventional method first creates a prefix codeword by using the TR binarization process. When the prefix bin string has more than the bit string of a predefined length (e.g. 4 in FIG. 2D and 3 in FIG. 2E respectively) with all bits equal to 1, the suffix bin string is present. In this case, only a fixed number of ONES are output as the prefix. The suffix bin string is then generated by using the EGk binarization process with an input symbol minus a predefined value, where the predefined value is selected according to Rice Parameter. Exp-Golomb order k can be set according to the Rice Parameter. This aforementioned conventional process is illustrated in FIG. 1. The steps of FIG. 1 are detailed as follows.
Step 100: Start the coding process;
Step 102: Create prefix bit string of the Truncated Rice (TR) codeword;
Step 104: Does the prefix bit string fit in with a predefined criterion? If yes, go to Step 110; if no, go to Step 106;
Step 106: Create a suffix bin string of the codeword and code the suffix using an EGk binarization scheme;
Step 108: Add the suffix bin string to the prefix bit string of the TR codeword;
Step 110: End.
Both the Rice Parameter and the predefined criterion may be constantly updated according to the input symbols being coded. The present invention therefore aims to provide a more direct method of coding.